<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../">
<head>
  <meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Grammar &mdash; The Logtalk Handbook v3.93.0-b01 documentation</title>
      <link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=d75fae25" />
      <link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=19f00094" />
      <link rel="stylesheet" type="text/css" href="../_static/css/custom.css?v=396eccfe" />

  
  <!--[if lt IE 9]>
    <script src="../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
        <script src="../_static/jquery.js?v=5d32c60e"></script>
        <script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
        <script src="../_static/documentation_options.js?v=c8100655"></script>
        <script src="../_static/doctools.js?v=9a2dae69"></script>
        <script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
    <script src="../_static/js/theme.js"></script>
    <!-- begin favicon -->
    <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
    <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
    <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
    <link rel="manifest" href="/site.webmanifest" />
    <link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5" />
    <meta name="msapplication-TileColor" content="#355b95" />
    <meta name="theme-color" content="#ffffff" />
    <!-- end favicon -->
    
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="Control constructs" href="control/index.html" />
    <link rel="prev" title="Reference Manual" href="index.html" />
   
</head>

<body class="wy-body-for-nav"> 
  <div class="wy-grid-for-nav">
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >

          
          
          <a href="../index.html" class="icon icon-home">
            The Logtalk Handbook
              <img src="../_static/logtalk.gif" class="logo" alt="Logo"/>
          </a>
              <div class="version">
                3.93.0
              </div>
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>
        </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
    
              <p class="caption" role="heading"><span class="caption-text">Contents</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../userman/index.html">User Manual</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="index.html">Reference Manual</a><ul class="current">
<li class="toctree-l2 current"><a class="current reference internal" href="#">Grammar</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#entities">Entities</a></li>
<li class="toctree-l3"><a class="reference internal" href="#object-definition">Object definition</a></li>
<li class="toctree-l3"><a class="reference internal" href="#category-definition">Category definition</a></li>
<li class="toctree-l3"><a class="reference internal" href="#protocol-definition">Protocol definition</a></li>
<li class="toctree-l3"><a class="reference internal" href="#entity-relations">Entity relations</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#implemented-protocols">Implemented protocols</a></li>
<li class="toctree-l4"><a class="reference internal" href="#extended-protocols">Extended protocols</a></li>
<li class="toctree-l4"><a class="reference internal" href="#imported-categories">Imported categories</a></li>
<li class="toctree-l4"><a class="reference internal" href="#extended-objects">Extended objects</a></li>
<li class="toctree-l4"><a class="reference internal" href="#extended-categories">Extended categories</a></li>
<li class="toctree-l4"><a class="reference internal" href="#instantiated-objects">Instantiated objects</a></li>
<li class="toctree-l4"><a class="reference internal" href="#specialized-objects">Specialized objects</a></li>
<li class="toctree-l4"><a class="reference internal" href="#complemented-objects">Complemented objects</a></li>
<li class="toctree-l4"><a class="reference internal" href="#entity-and-predicate-scope">Entity and predicate scope</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#entity-identifiers">Entity identifiers</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#object-identifiers">Object identifiers</a></li>
<li class="toctree-l4"><a class="reference internal" href="#category-identifiers">Category identifiers</a></li>
<li class="toctree-l4"><a class="reference internal" href="#protocol-identifiers">Protocol identifiers</a></li>
<li class="toctree-l4"><a class="reference internal" href="#module-identifiers">Module identifiers</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#source-files">Source files</a></li>
<li class="toctree-l3"><a class="reference internal" href="#source-file-names">Source file names</a></li>
<li class="toctree-l3"><a class="reference internal" href="#terms">Terms</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#object-terms">Object terms</a></li>
<li class="toctree-l4"><a class="reference internal" href="#category-terms">Category terms</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#directives">Directives</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#source-file-directives">Source file directives</a></li>
<li class="toctree-l4"><a class="reference internal" href="#conditional-compilation-directives">Conditional compilation directives</a></li>
<li class="toctree-l4"><a class="reference internal" href="#object-directives">Object directives</a></li>
<li class="toctree-l4"><a class="reference internal" href="#category-directives">Category directives</a></li>
<li class="toctree-l4"><a class="reference internal" href="#protocol-directives">Protocol directives</a></li>
<li class="toctree-l4"><a class="reference internal" href="#predicate-directives">Predicate directives</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#clauses-and-goals">Clauses and goals</a></li>
<li class="toctree-l3"><a class="reference internal" href="#lambda-expressions">Lambda expressions</a></li>
<li class="toctree-l3"><a class="reference internal" href="#entity-properties">Entity properties</a></li>
<li class="toctree-l3"><a class="reference internal" href="#predicate-properties">Predicate properties</a></li>
<li class="toctree-l3"><a class="reference internal" href="#compiler-flags">Compiler flags</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="control/index.html">Control constructs</a></li>
<li class="toctree-l2"><a class="reference internal" href="directives/index.html">Directives</a></li>
<li class="toctree-l2"><a class="reference internal" href="predicates/index.html">Built-in predicates</a></li>
<li class="toctree-l2"><a class="reference internal" href="methods/index.html">Built-in methods</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a></li>
<li class="toctree-l1"><a class="reference internal" href="../faq/index.html">FAQ</a></li>
<li class="toctree-l1"><a class="reference internal" href="../devtools/index.html">Developer Tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a></li>
<li class="toctree-l1"><a class="reference internal" href="../ports/index.html">Ports</a></li>
<li class="toctree-l1"><a class="reference internal" href="../contributions/index.html">Contributions</a></li>
<li class="toctree-l1"><a class="reference internal" href="../glossary.html">Glossary</a></li>
<li class="toctree-l1"><a class="reference internal" href="../bibliography.html">Bibliography</a></li>
<li class="toctree-l1"><a class="reference internal" href="../genindex.html">Index</a></li>
</ul>

    <p class="caption"><span class="caption-text">External Contents</span></p>
    <ul>
    <li class="toctree-l1"><a class="reference internal" href="../../apis/index.html">APIs</a></li>
    <li class="toctree-l1"><a class="reference internal" href="https://logtalk.org">Logtalk website</a></li>
    <li class="toctree-l1"><a class="reference internal" href="https://github.com/LogtalkDotOrg/logtalk3">GitHub repo</a></li>
    </ul>
  
        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../index.html">The Logtalk Handbook</a>
      </nav>

      <div class="wy-nav-content">
        <div class="rst-content">
          <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
          <li class="breadcrumb-item"><a href="index.html">Reference Manual</a></li>
      <li class="breadcrumb-item active">Grammar</li>
      <li class="wy-breadcrumbs-aside">
              <a href="https://github.com/LogtalkDotOrg/logtalk3/blob/master/docs/handbook/sources/refman/grammar.rst" class="fa fa-github"> Edit on GitHub</a>
      </li>
  </ul>
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
             
  <section id="grammar">
<span id="grammar-grammar"></span><h1>Grammar<a class="headerlink" href="#grammar" title="Link to this heading"></a></h1>
<p>The Logtalk grammar is here described using W3C-style Extended Backus-Naur
Form syntax. Non-terminal symbols not defined here can be found in the ISO
Prolog Core standard. Terminal symbols are represented between double-quotes.</p>
<section id="entities">
<span id="grammar-entities"></span><h2>Entities<a class="headerlink" href="#entities" title="Link to this heading"></a></h2>
<div class="highlight-bnf notranslate"><div class="highlight"><pre><span></span>entity <span class="o">::=</span>
   object
   | category
   | protocol
</pre></div>
</div>
</section>
<section id="object-definition">
<span id="grammar-object-definition"></span><h2>Object definition<a class="headerlink" href="#object-definition" title="Link to this heading"></a></h2>
<div class="highlight-bnf notranslate"><div class="highlight"><pre><span></span>object <span class="o">::=</span>
   begin_object_directive ( object_term )* end_object_directive

begin_object_directive <span class="o">::=</span>
   &quot;:- object(&quot; object_identifier ( &quot;,&quot; object_relations )? &quot;).&quot;

end_object_directive <span class="o">::=</span>
   &quot;:- end_object.&quot;

object_relations <span class="o">::=</span>
   prototype_relations
   | non_prototype_relations

prototype_relations <span class="o">::=</span>
   prototype_relation
   | prototype_relation &quot;,&quot; prototype_relations

prototype_relation <span class="o">::=</span>
   implements_protocols
   | imports_categories
   | extends_objects

non_prototype_relations <span class="o">::=</span>
   non_prototype_relation
   | non_prototype_relation &quot;,&quot; non_prototype_relations

non_prototype_relation <span class="o">::=</span>
   implements_protocols
   | imports_categories
   | instantiates_classes
   | specializes_classes
</pre></div>
</div>
</section>
<section id="category-definition">
<span id="grammar-category-definition"></span><h2>Category definition<a class="headerlink" href="#category-definition" title="Link to this heading"></a></h2>
<div class="highlight-bnf notranslate"><div class="highlight"><pre><span></span>category <span class="o">::=</span>
   begin_category_directive  ( category_term )* end_category_directive

begin_category_directive <span class="o">::=</span>
   &quot;:- category(&quot; category_identifier ( &quot;,&quot; category_relations )? &quot;).&quot;

end_category_directive <span class="o">::=</span>
   &quot;:- end_category.&quot;

category_relations <span class="o">::=</span>
   category_relation
   | category_relation &quot;,&quot; category_relations

category_relation <span class="o">::=</span>
   implements_protocols
   | extends_categories
   | complements_objects
</pre></div>
</div>
</section>
<section id="protocol-definition">
<span id="grammar-protocol-definition"></span><h2>Protocol definition<a class="headerlink" href="#protocol-definition" title="Link to this heading"></a></h2>
<div class="highlight-bnf notranslate"><div class="highlight"><pre><span></span>protocol <span class="o">::=</span>
   begin_protocol_directive  ( protocol_directive )* end_protocol_directive

begin_protocol_directive <span class="o">::=</span>
   &quot;:- protocol(&quot; protocol_identifier ( &quot;,&quot; extends_protocols)? &quot;).&quot;

end_protocol_directive <span class="o">::=</span>
   &quot;:- end_protocol.&quot;
</pre></div>
</div>
</section>
<section id="entity-relations">
<span id="grammar-entity-relations"></span><h2>Entity relations<a class="headerlink" href="#entity-relations" title="Link to this heading"></a></h2>
<div class="highlight-bnf notranslate"><div class="highlight"><pre><span></span>extends_protocols <span class="o">::=</span>
   &quot;extends(&quot; extended_protocols &quot;)&quot;

extends_objects <span class="o">::=</span>
   &quot;extends(&quot; extended_objects &quot;)&quot;

extends_categories <span class="o">::=</span>
   &quot;extends(&quot; extended_categories &quot;)&quot;

implements_protocols <span class="o">::=</span>
   &quot;implements(&quot; implemented_protocols &quot;)&quot;

imports_categories <span class="o">::=</span>
   &quot;imports(&quot; imported_categories &quot;)&quot;

instantiates_classes <span class="o">::=</span>
   &quot;instantiates(&quot; instantiated_objects &quot;)&quot;

specializes_classes <span class="o">::=</span>
   &quot;specializes(&quot; specialized_objects &quot;)&quot;

complements_objects <span class="o">::=</span>
   &quot;complements(&quot; complemented_objects &quot;)&quot;
</pre></div>
</div>
<section id="implemented-protocols">
<span id="grammar-implemented-protocols"></span><h3>Implemented protocols<a class="headerlink" href="#implemented-protocols" title="Link to this heading"></a></h3>
<div class="highlight-bnf notranslate"><div class="highlight"><pre><span></span>implemented_protocols <span class="o">::=</span>
   implemented_protocol
   | implemented_protocol_sequence
   | implemented_protocol_list

implemented_protocol <span class="o">::=</span>
   protocol_identifier
   | scope &quot;::&quot; protocol_identifier

implemented_protocol_sequence <span class="o">::=</span>
   implemented_protocol
   | implemented_protocol &quot;,&quot; implemented_protocol_sequence

implemented_protocol_list <span class="o">::=</span>
   &quot;[&quot; implemented_protocol_sequence &quot;]&quot;
</pre></div>
</div>
</section>
<section id="extended-protocols">
<span id="grammar-extended-protocols"></span><h3>Extended protocols<a class="headerlink" href="#extended-protocols" title="Link to this heading"></a></h3>
<div class="highlight-bnf notranslate"><div class="highlight"><pre><span></span>extended_protocols <span class="o">::=</span>
   extended_protocol
   | extended_protocol_sequence
   | extended_protocol_list

extended_protocol <span class="o">::=</span>
   protocol_identifier
   | scope &quot;::&quot; protocol_identifier

extended_protocol_sequence <span class="o">::=</span>
   extended_protocol
   |extended_protocol &quot;,&quot; extended_protocol_sequence

extended_protocol_list <span class="o">::=</span>
   &quot;[&quot; extended_protocol_sequence &quot;]&quot;
</pre></div>
</div>
</section>
<section id="imported-categories">
<span id="grammar-imported-categories"></span><h3>Imported categories<a class="headerlink" href="#imported-categories" title="Link to this heading"></a></h3>
<div class="highlight-bnf notranslate"><div class="highlight"><pre><span></span>imported_categories <span class="o">::=</span>
   imported_category
   | imported_category_sequence
   | imported_category_list

imported_category <span class="o">::=</span>
   category_identifier
   | scope &quot;::&quot; category_identifier

imported_category_sequence <span class="o">::=</span>
   imported_category
   | imported_category &quot;,&quot; imported_category_sequence

imported_category_list <span class="o">::=</span>
   &quot;[&quot; imported_category_sequence &quot;]&quot;
</pre></div>
</div>
</section>
<section id="extended-objects">
<span id="grammar-extended-objects"></span><h3>Extended objects<a class="headerlink" href="#extended-objects" title="Link to this heading"></a></h3>
<div class="highlight-bnf notranslate"><div class="highlight"><pre><span></span>extended_objects <span class="o">::=</span>
   extended_object
   | extended_object_sequence
   | extended_object_list

extended_object <span class="o">::=</span>
   object_identifier
   | scope &quot;::&quot; object_identifier

extended_object_sequence <span class="o">::=</span>
   extended_object
   | extended_object &quot;,&quot; extended_object_sequence

extended_object_list <span class="o">::=</span>
   &quot;[&quot; extended_object_sequence &quot;]&quot;
</pre></div>
</div>
</section>
<section id="extended-categories">
<span id="grammar-extended-categories"></span><h3>Extended categories<a class="headerlink" href="#extended-categories" title="Link to this heading"></a></h3>
<div class="highlight-bnf notranslate"><div class="highlight"><pre><span></span>extended_categories <span class="o">::=</span>
   extended_category
   | extended_category_sequence
   | extended_category_list

extended_category <span class="o">::=</span>
   category_identifier
   | scope &quot;::&quot; category_identifier

extended_category_sequence <span class="o">::=</span>
   extended_category
   | extended_category &quot;,&quot; extended_category_sequence

extended_category_list <span class="o">::=</span>
   &quot;[&quot; extended_category_sequence &quot;]&quot;
</pre></div>
</div>
</section>
<section id="instantiated-objects">
<span id="grammar-instantiated-objects"></span><h3>Instantiated objects<a class="headerlink" href="#instantiated-objects" title="Link to this heading"></a></h3>
<div class="highlight-bnf notranslate"><div class="highlight"><pre><span></span>instantiated_objects <span class="o">::=</span>
   instantiated_object
   | instantiated_object_sequence
   | instantiated_object_list

instantiated_object <span class="o">::=</span>
   object_identifier
   | scope &quot;::&quot; object_identifier

instantiated_object_sequence <span class="o">::=</span>
   instantiated_object
   | instantiated_object &quot;,&quot; instantiated_object_sequence

instantiated_object_list <span class="o">::=</span>
   &quot;[&quot; instantiated_object_sequence &quot;]&quot;
</pre></div>
</div>
</section>
<section id="specialized-objects">
<span id="grammar-specialized-objects"></span><h3>Specialized objects<a class="headerlink" href="#specialized-objects" title="Link to this heading"></a></h3>
<div class="highlight-bnf notranslate"><div class="highlight"><pre><span></span>specialized_objects <span class="o">::=</span>
   specialized_object
   | specialized_object_sequence
   | specialized_object_list

specialized_object <span class="o">::=</span>
   object_identifier
   | scope &quot;::&quot; object_identifier

specialized_object_sequence <span class="o">::=</span>
   specialized_object
   | specialized_object &quot;,&quot; specialized_object_sequence

specialized_object_list <span class="o">::=</span>
   &quot;[&quot; specialized_object_sequence &quot;]&quot;
</pre></div>
</div>
</section>
<section id="complemented-objects">
<span id="grammar-complemented-objects"></span><h3>Complemented objects<a class="headerlink" href="#complemented-objects" title="Link to this heading"></a></h3>
<div class="highlight-bnf notranslate"><div class="highlight"><pre><span></span>complemented_objects <span class="o">::=</span>
   object_identifier
   | complemented_object_sequence
   | complemented_object_list

complemented_object_sequence <span class="o">::=</span>
   object_identifier
   | object_identifier &quot;,&quot; complemented_object_sequence

complemented_object_list <span class="o">::=</span>
   &quot;[&quot; complemented_object_sequence &quot;]&quot;
</pre></div>
</div>
</section>
<section id="entity-and-predicate-scope">
<span id="grammar-scope"></span><h3>Entity and predicate scope<a class="headerlink" href="#entity-and-predicate-scope" title="Link to this heading"></a></h3>
<div class="highlight-bnf notranslate"><div class="highlight"><pre><span></span>scope <span class="o">::=</span>
   &quot;public&quot;
   | &quot;protected&quot;
   | &quot;private&quot;
</pre></div>
</div>
</section>
</section>
<section id="entity-identifiers">
<span id="grammar-entity-identifiers"></span><h2>Entity identifiers<a class="headerlink" href="#entity-identifiers" title="Link to this heading"></a></h2>
<div class="highlight-bnf notranslate"><div class="highlight"><pre><span></span>entity_identifier <span class="o">::=</span>
   object_identifier
   | protocol_identifier
   | category_identifier
</pre></div>
</div>
<section id="object-identifiers">
<span id="grammar-object-identifiers"></span><h3>Object identifiers<a class="headerlink" href="#object-identifiers" title="Link to this heading"></a></h3>
<div class="highlight-bnf notranslate"><div class="highlight"><pre><span></span>object_identifier <span class="o">::=</span>
   atom
   | compound
</pre></div>
</div>
</section>
<section id="category-identifiers">
<span id="grammar-category-identifiers"></span><h3>Category identifiers<a class="headerlink" href="#category-identifiers" title="Link to this heading"></a></h3>
<div class="highlight-bnf notranslate"><div class="highlight"><pre><span></span>category_identifier <span class="o">::=</span>
   atom
   | compound
</pre></div>
</div>
</section>
<section id="protocol-identifiers">
<span id="grammar-protocol-identifiers"></span><h3>Protocol identifiers<a class="headerlink" href="#protocol-identifiers" title="Link to this heading"></a></h3>
<div class="highlight-bnf notranslate"><div class="highlight"><pre><span></span>protocol_identifier <span class="o">::=</span>
   atom
</pre></div>
</div>
</section>
<section id="module-identifiers">
<span id="grammar-module-identifiers"></span><h3>Module identifiers<a class="headerlink" href="#module-identifiers" title="Link to this heading"></a></h3>
<div class="highlight-bnf notranslate"><div class="highlight"><pre><span></span>module_identifier <span class="o">::=</span>
   atom
</pre></div>
</div>
</section>
</section>
<section id="source-files">
<span id="grammar-source-files"></span><h2>Source files<a class="headerlink" href="#source-files" title="Link to this heading"></a></h2>
<div class="highlight-bnf notranslate"><div class="highlight"><pre><span></span>source_file <span class="o">::=</span>
   ( source_file_content )*

source_file_content <span class="o">::=</span>
   source_file_directive
   | clause
   | grammar_rule
   | entity
</pre></div>
</div>
</section>
<section id="source-file-names">
<span id="grammar-source-file-names"></span><h2>Source file names<a class="headerlink" href="#source-file-names" title="Link to this heading"></a></h2>
<div class="highlight-bnf notranslate"><div class="highlight"><pre><span></span>source_file_name <span class="o">::=</span>
   atom
   | library_source_file_name

library_source_file_name <span class="o">::=</span>
   library_name &quot;(&quot; atom &quot;)&quot;

library_name <span class="o">::=</span>
   atom
</pre></div>
</div>
</section>
<section id="terms">
<span id="grammar-terms"></span><h2>Terms<a class="headerlink" href="#terms" title="Link to this heading"></a></h2>
<section id="object-terms">
<span id="grammar-object-terms"></span><h3>Object terms<a class="headerlink" href="#object-terms" title="Link to this heading"></a></h3>
<div class="highlight-bnf notranslate"><div class="highlight"><pre><span></span>object_term <span class="o">::=</span>
   object_directive
   | clause
   | grammar_rule
</pre></div>
</div>
</section>
<section id="category-terms">
<span id="grammar-category-terms"></span><h3>Category terms<a class="headerlink" href="#category-terms" title="Link to this heading"></a></h3>
<div class="highlight-bnf notranslate"><div class="highlight"><pre><span></span>category_term <span class="o">::=</span>
   category_directive
   | clause
   | grammar_rule
</pre></div>
</div>
</section>
</section>
<section id="directives">
<span id="grammar-directives"></span><h2>Directives<a class="headerlink" href="#directives" title="Link to this heading"></a></h2>
<section id="source-file-directives">
<span id="grammar-source-file-directives"></span><h3>Source file directives<a class="headerlink" href="#source-file-directives" title="Link to this heading"></a></h3>
<div class="highlight-bnf notranslate"><div class="highlight"><pre><span></span>source_file_directive <span class="o">::=</span>
   &quot;:- encoding(&quot; atom &quot;).&quot;
   | &quot;:- set_logtalk_flag(&quot; atom &quot;,&quot; nonvar &quot;).&quot;
   | &quot;:- include(&quot; source_file_name &quot;).&quot;
   | prolog_directive
</pre></div>
</div>
</section>
<section id="conditional-compilation-directives">
<span id="grammar-conditional-compilation-directives"></span><h3>Conditional compilation directives<a class="headerlink" href="#conditional-compilation-directives" title="Link to this heading"></a></h3>
<div class="highlight-bnf notranslate"><div class="highlight"><pre><span></span>conditional_compilation_directive <span class="o">::=</span>
   &quot;:- if(&quot; callable &quot;).&quot;
   | &quot;:- elif(&quot; callable &quot;).&quot;
   | &quot;:- else.&quot;
   | &quot;:- endif.&quot;
</pre></div>
</div>
</section>
<section id="object-directives">
<span id="grammar-object-directives"></span><h3>Object directives<a class="headerlink" href="#object-directives" title="Link to this heading"></a></h3>
<div class="highlight-bnf notranslate"><div class="highlight"><pre><span></span>object_directive <span class="o">::=</span>
   &quot;:- initialization(&quot; callable &quot;).&quot;
   | &quot;:- built_in.&quot;
   | &quot;:- threaded.&quot;
   | &quot;:- dynamic.&quot;
   | &quot;:- info(&quot; entity_info_list &quot;).&quot;
   | &quot;:- set_logtalk_flag(&quot; atom &quot;,&quot; nonvar &quot;).&quot;
   | &quot;:- include(&quot; source_file_name &quot;).&quot;
   | &quot;:- uses(&quot; object_alias_list &quot;).&quot;
   | &quot;:- use_module(&quot; module_alias_list &quot;).&quot;
   | conditional_compilation_directive
   | predicate_directive
</pre></div>
</div>
</section>
<section id="category-directives">
<span id="grammar-category-directives"></span><h3>Category directives<a class="headerlink" href="#category-directives" title="Link to this heading"></a></h3>
<div class="highlight-bnf notranslate"><div class="highlight"><pre><span></span>category_directive <span class="o">::=</span>
   &quot;:- built_in.&quot;
   | &quot;:- dynamic.&quot;
   | &quot;:- info(&quot; entity_info_list &quot;).&quot;
   | &quot;:- set_logtalk_flag(&quot; atom &quot;,&quot; nonvar &quot;).&quot;
   | &quot;:- include(&quot; source_file_name &quot;).&quot;
   | &quot;:- uses(&quot; object_alias_list &quot;).&quot;
   | &quot;:- use_module(&quot; module_alias_list &quot;).&quot;
   | conditional_compilation_directive
   | predicate_directive
</pre></div>
</div>
</section>
<section id="protocol-directives">
<span id="grammar-protocol-directives"></span><h3>Protocol directives<a class="headerlink" href="#protocol-directives" title="Link to this heading"></a></h3>
<div class="highlight-bnf notranslate"><div class="highlight"><pre><span></span>protocol_directive <span class="o">::=</span>
   &quot;:- built_in.&quot;
   | &quot;:- dynamic.&quot;
   | &quot;:- info(&quot; entity_info_list &quot;).&quot;
   | &quot;:- set_logtalk_flag(&quot; atom &quot;,&quot; nonvar &quot;).&quot;
   | &quot;:- include(&quot; source_file_name &quot;).&quot;
   | conditional_compilation_directive
   | predicate_directive
</pre></div>
</div>
</section>
<section id="predicate-directives">
<span id="grammar-predicate-directives"></span><h3>Predicate directives<a class="headerlink" href="#predicate-directives" title="Link to this heading"></a></h3>
<div class="highlight-bnf notranslate"><div class="highlight"><pre><span></span>predicate_directive <span class="o">::=</span>
   alias_directive
   | synchronized_directive
   | uses_directive
   | use_module_directive
   | scope_directive
   | mode_directive
   | meta_predicate_directive
   | meta_non_terminal_directive
   | info_directive
   | dynamic_directive
   | discontiguous_directive
   | multifile_directive
   | coinductive_directive
   | operator_directive

alias_directive <span class="o">::=</span>
   &quot;:- alias(&quot; entity_identifier &quot;,&quot; alias_directive_resource_list &quot;).&quot;

synchronized_directive <span class="o">::=</span>
   &quot;:- synchronized(&quot; synchronized_directive_resource_term &quot;).&quot;

uses_directive <span class="o">::=</span>
   &quot;:- uses(&quot; ( object_identifier | parameter_variable ) &quot;,&quot; uses_directive_resource_list &quot;).&quot;

use_module_directive <span class="o">::=</span>
   &quot;:- use_module(&quot; ( module_identifier | parameter_variable ) &quot;,&quot; use_module_directive_resource_list &quot;).&quot;

scope_directive <span class="o">::=</span>
   &quot;:- public(&quot; scope_directive_resource_term &quot;).&quot;
   | &quot;:- protected(&quot; scope_directive_resource_term &quot;).&quot;
   | &quot;:- private(&quot; scope_directive_resource_term &quot;).&quot;

mode_directive <span class="o">::=</span>
   &quot;:- mode(&quot; ( predicate_mode_term | non_terminal_mode_term ) &quot;,&quot; number_of_proofs &quot;).&quot;

meta_predicate_directive <span class="o">::=</span>
   &quot;:- meta_predicate(&quot; meta_predicate_template_term &quot;).&quot;

meta_non_terminal_directive <span class="o">::=</span>
   &quot;:- meta_non_terminal(&quot; meta_non_terminal_template_term &quot;).&quot;

info_directive <span class="o">::=</span>
   &quot;:- info(&quot; ( predicate_indicator | non_terminal_indicator ) &quot;,&quot; predicate_info_list &quot;).&quot;

dynamic_directive <span class="o">::=</span>
   &quot;:- dynamic(&quot; qualified_directive_resource_term &quot;).&quot;

discontiguous_directive <span class="o">::=</span>
   &quot;:- discontiguous(&quot; qualified_directive_resource_term &quot;).&quot;

multifile_directive <span class="o">::=</span>
   &quot;:- multifile(&quot; qualified_directive_resource_term &quot;).&quot;

coinductive_directive <span class="o">::=</span>
   &quot;:- coinductive(&quot; ( predicate_indicator_term | coinductive_predicate_template_term ) &quot;).&quot;

parameter_variable <span class="o">::=</span>
   _variable_

scope_directive_resource_term <span class="o">::=</span>
   scope_directive_resource
   | scope_directive_resource_sequence
   | scope_directive_resource_list

scope_directive_resource <span class="o">::=</span>
   predicate_indicator
   | non_terminal_indicator
   | operator

scope_directive_resource_sequence <span class="o">::=</span>
   scope_directive_resource
   | scope_directive_resource &quot;,&quot; scope_directive_resource_sequence

scope_directive_resource_list <span class="o">::=</span>
   &quot;[&quot; scope_directive_resource_sequence &quot;]&quot;

entity_resources_list <span class="o">::=</span>
   predicate_indicator_list
   | operator_list

predicate_indicator_term <span class="o">::=</span>
   predicate_indicator
   | predicate_indicator_sequence
   | predicate_indicator_list

predicate_indicator_sequence <span class="o">::=</span>
   predicate_indicator
   | predicate_indicator &quot;,&quot; predicate_indicator_sequence

predicate_indicator_list <span class="o">::=</span>
   &quot;[&quot; predicate_indicator_sequence &quot;]&quot;

alias_directive_resource_list <span class="o">::=</span>
   &quot;[&quot; alias_directive_resource_sequence &quot;]&quot;

alias_directive_resource_sequence <span class="o">::=</span>
   alias_directive_resource
   | alias_directive_resource &quot;,&quot; alias_directive_resource_sequence

alias_directive_resource <span class="o">::=</span>
   predicate_indicator_alias
   | non_terminal_indicator_alias

synchronized_directive_resource_term <span class="o">::=</span>
   synchronized_directive_resource
   | synchronized_directive_resource_sequence
   | synchronized_directive_resource_list

synchronized_directive_resource <span class="o">::=</span>
   predicate_indicator
   | non_terminal_indicator

synchronized_directive_resource_sequence <span class="o">::=</span>
   synchronized_directive_resource
   | synchronized_directive_resource &quot;,&quot; synchronized_directive_resource_sequence

synchronized_directive_resource_list <span class="o">::=</span>
   &quot;[&quot; synchronized_directive_resource_sequence &quot;]&quot;

uses_directive_resource_list <span class="o">::=</span>
   &quot;[&quot; uses_directive_resource_sequence &quot;]&quot;

uses_directive_resource_sequence <span class="o">::=</span>
   uses_directive_resource
   | uses_directive_resource &quot;,&quot; uses_directive_resource_sequence

uses_directive_resource <span class="o">::=</span>
   predicate_indicator
   | non_terminal_indicator
   | predicate_template_alias
   | operator

use_module_directive_resource_list <span class="o">::=</span>
   &quot;[&quot; use_module_directive_resource_sequence &quot;]&quot;

use_module_directive_resource_sequence <span class="o">::=</span>
   use_module_directive_resource
   | use_module_directive_resource &quot;,&quot; use_module_directive_resource_sequence

use_module_directive_resource <span class="o">::=</span>
   predicate_indicator
   | non_terminal_indicator
   | predicate_template_alias
   | operator

qualified_directive_resource_term <span class="o">::=</span>
   qualified_directive_resource
   | qualified_directive_resource_sequence
   | qualified_directive_resource_list

qualified_directive_resource_sequence <span class="o">::=</span>
   qualified_directive_resource
   | qualified_directive_resource &quot;,&quot; qualified_directive_resource_sequence

qualified_directive_resource_list <span class="o">::=</span>
   &quot;[&quot; qualified_directive_resource_sequence &quot;]&quot;

qualified_directive_resource <span class="o">::=</span>
   predicate_indicator
   | non_terminal_indicator
   | object_identifier &quot;::&quot; ( predicate_indicator | non_terminal_indicator)
   | category_identifier &quot;::&quot; ( predicate_indicator | non_terminal_indicator)
   | module_identifier &quot;:&quot; ( predicate_indicator | non_terminal_indicator)

predicate_indicator_alias <span class="o">::=</span>
   predicate_indicator &quot;as&quot; predicate_indicator

predicate_template_alias <span class="o">::=</span>
   callable &quot;as&quot; callable

non_terminal_indicator <span class="o">::=</span>
   functor &quot;//&quot; arity

non_terminal_indicator_alias <span class="o">::=</span>
   non_terminal_indicator &quot;as&quot; non_terminal_indicator

operator_sequence <span class="o">::=</span>
   operator specification
   | operator specification &quot;,&quot; operator_sequence

operator_list <span class="o">::=</span>
   &quot;[&quot; operator_sequence &quot;]&quot;

coinductive_predicate_template_term <span class="o">::=</span>
   coinductive_predicate_template
   | coinductive_predicate_template_sequence
   | coinductive_predicate_template_list

coinductive_predicate_template_sequence <span class="o">::=</span>
   coinductive_predicate_template
   | coinductive_predicate_template &quot;,&quot; coinductive_predicate_template_sequence

coinductive_predicate_template_list <span class="o">::=</span>
   &quot;[&quot; coinductive_predicate_template_sequence &quot;]&quot;

coinductive_predicate_template <span class="o">::=</span>
   atom &quot;(&quot; coinductive_mode_terms &quot;)&quot;

coinductive_mode_terms <span class="o">::=</span>
   coinductive_mode_term
   | coinductive_mode_terms &quot;,&quot; coinductive_mode_terms

coinductive_mode_term <span class="o">::=</span>
   &quot;+&quot;
   | &quot;-&quot;

predicate_mode_term <span class="o">::=</span>
   atom &quot;(&quot; mode_terms &quot;)&quot;

non_terminal_mode_term <span class="o">::=</span>
   atom &quot;(&quot; mode_terms &quot;)&quot;

mode_terms <span class="o">::=</span>
   mode_term
   |mode_term &quot;,&quot; mode_terms

mode_term <span class="o">::=</span>
   &quot;@&quot;  type?
   | &quot;+&quot; type?
   | &quot;-&quot; type?
   | &quot;?&quot; type?
   | &quot;++&quot; type?
   | &quot;--&quot; type?

type <span class="o">::=</span>
   prolog_type | logtalk_type | user_defined_type

prolog_type <span class="o">::=</span>
   &quot;term&quot;
   | &quot;nonvar&quot;
   | &quot;var&quot;
   | &quot;compound&quot;
   | &quot;ground&quot;
   | &quot;callable&quot;
   | &quot;list&quot;
   | &quot;atomic&quot;
   | &quot;atom&quot;
   | &quot;number&quot;
   | &quot;integer&quot;
   | &quot;float&quot;

logtalk_type <span class="o">::=</span>
   &quot;object&quot;
   | &quot;category&quot;
   | &quot;protocol&quot;
   | &quot;event&quot;

user_defined_type <span class="o">::=</span>
   atom
   | compound

number_of_proofs <span class="o">::=</span>
   &quot;zero&quot;
   | &quot;zero_or_one&quot;
   | &quot;zero_or_more&quot;
   | &quot;one&quot;
   | &quot;one_or_more&quot;
   | &quot;zero_or_error&quot;
   | &quot;one_or_error&quot;
   | &quot;zero_or_one_or_error&quot;
   | &quot;zero_or_more_or_error&quot;
   | &quot;one_or_more_or_error&quot;
   | &quot;error&quot;

meta_predicate_template_term <span class="o">::=</span>
   meta_predicate_template
   | meta_predicate_template_sequence
   | meta_predicate_template_list

meta_predicate_template_sequence <span class="o">::=</span>
   meta_predicate_template
   | meta_predicate_template &quot;,&quot; meta_predicate_template_sequence

meta_predicate_template_list <span class="o">::=</span>
   &quot;[&quot; meta_predicate_template_sequence &quot;]&quot;

meta_predicate_template <span class="o">::=</span>
   object_identifier &quot;::&quot; atom &quot;(&quot; meta_predicate_specifiers &quot;)&quot;
   | category_identifier &quot;::&quot; atom &quot;(&quot; meta_predicate_specifiers &quot;)&quot;
   | module_identifier &quot;:&quot; atom &quot;(&quot; meta_predicate_specifiers &quot;)&quot;
   | atom &quot;(&quot; meta_predicate_specifiers &quot;)&quot;

meta_predicate_specifiers <span class="o">::=</span>
   meta_predicate_specifier
   | meta_predicate_specifier &quot;,&quot; meta_predicate_specifiers

meta_predicate_specifier <span class="o">::=</span>
   non_negative_integer
   | &quot;::&quot;
   | &quot;^&quot;
   | &quot;*&quot;

meta_non_terminal_template_term <span class="o">::=</span>
   meta_predicate_template_term

entity_info_list <span class="o">::=</span>
   &quot;[&quot; entity_info_sequence? &quot;]&quot;

entity_info_sequence <span class="o">::=</span>
   entity_info_item &quot;is&quot; nonvar
   | entity_info_item &quot;is&quot; nonvar &quot;,&quot; entity_info_sequence

entity_info_item <span class="o">::=</span>
   &quot;comment&quot;
   | &quot;remarks&quot;
   | &quot;author&quot;
   | &quot;version&quot;
   | &quot;date&quot;
   | &quot;copyright&quot;
   | &quot;license&quot;
   | &quot;parameters&quot;
   | &quot;parnames&quot;
   | &quot;see_also&quot;
   | atom

predicate_info_list <span class="o">::=</span>
   &quot;[&quot; predicate_info_sequence? &quot;]&quot;

predicate_info_sequence <span class="o">::=</span>
   predicate_info_item &quot;is&quot; nonvar
   | predicate_info_item &quot;is&quot; nonvar &quot;,&quot; predicate_info_sequence

predicate_info_item <span class="o">::=</span>
   &quot;comment&quot;
   | &quot;remarks&quot;
   | &quot;arguments&quot;
   | &quot;argnames&quot;
   | &quot;redefinition&quot;
   | &quot;allocation&quot;
   | &quot;examples&quot;
   | &quot;exceptions&quot;
   | &quot;see_also&quot;
   | atom

object_alias_list <span class="o">::=</span>
   &quot;[&quot; object_alias_sequence &quot;]&quot;

object_alias_sequence <span class="o">::=</span>
   object_alias
   | object_alias &quot;,&quot; object_alias_sequence

object_alias <span class="o">::=</span>
   object_identifier &quot;as&quot; object_identifier

module_alias_list <span class="o">::=</span>
   &quot;[&quot; module_alias_sequence &quot;]&quot;

module_alias_sequence <span class="o">::=</span>
   module_alias
   | module_alias &quot;,&quot; module_alias_sequence

module_alias <span class="o">::=</span>
   module_identifier &quot;as&quot; module_identifier
</pre></div>
</div>
</section>
</section>
<section id="clauses-and-goals">
<span id="grammar-clauses"></span><h2>Clauses and goals<a class="headerlink" href="#clauses-and-goals" title="Link to this heading"></a></h2>
<div class="highlight-bnf notranslate"><div class="highlight"><pre><span></span>clause <span class="o">::=</span>
   object_identifier &quot;::&quot; head &quot;:-&quot; body
   | module_identifier &quot;:&quot; head &quot;:-&quot; body
   | head &quot;:-&quot; body
   | object_identifier &quot;::&quot; fact
   | module_identifier &quot;:&quot; fact
   | fact

goal <span class="o">::=</span>
   message_sending
   | super_call
   | external_call
   | context_switching_call
   | callable

message_sending <span class="o">::=</span>
   message_to_object
   | message_delegation
   | message_to_self

message_to_object <span class="o">::=</span>
   receiver &quot;::&quot; messages

message_delegation <span class="o">::=</span>
   &quot;[&quot; message_to_object &quot;]&quot;

message_to_self <span class="o">::=</span>
   &quot;::&quot; messages

super_call <span class="o">::=</span>
   &quot;^^&quot; message

messages <span class="o">::=</span>
   message
   | &quot;(&quot; message &quot;,&quot; messages &quot;)&quot;
   | &quot;(&quot; message &quot;;&quot; messages &quot;)&quot;
   | &quot;(&quot; message &quot;-&gt;&quot; messages &quot;)&quot;

message <span class="o">::=</span>
   callable
   | variable

receiver <span class="o">::=</span>
   &quot;{&quot; callable &quot;}&quot;
   | object_identifier
   | variable

external_call <span class="o">::=</span>
   &quot;{&quot; callable &quot;}&quot;

context_switching_call <span class="o">::=</span>
   object_identifier &quot;&lt;&lt;&quot; callable
</pre></div>
</div>
</section>
<section id="lambda-expressions">
<span id="grammar-lambdas"></span><h2>Lambda expressions<a class="headerlink" href="#lambda-expressions" title="Link to this heading"></a></h2>
<div class="highlight-bnf notranslate"><div class="highlight"><pre><span></span>lambda_expression <span class="o">::=</span>
   lambda_free_variables &quot;/&quot; lambda_parameters &quot;&gt;&gt;&quot; callable
   | lambda_free_variables &quot;/&quot; callable
   | lambda_parameters &quot;&gt;&gt;&quot; callable

lambda_free_variables <span class="o">::=</span>
   &quot;{&quot; variables? &quot;}&quot;

lambda_parameters <span class="o">::=</span>
   &quot;[&quot; terms? &quot;]&quot;

variables <span class="o">::=</span>
   variable
   | variable &quot;,&quot; variables

terms <span class="o">::=</span>
   term
   | term &quot;,&quot; terms
</pre></div>
</div>
</section>
<section id="entity-properties">
<span id="grammar-entity-properties"></span><h2>Entity properties<a class="headerlink" href="#entity-properties" title="Link to this heading"></a></h2>
<div class="highlight-bnf notranslate"><div class="highlight"><pre><span></span>category_property <span class="o">::=</span>
   &quot;static&quot;
   | &quot;dynamic&quot;
   | &quot;built_in&quot;
   | &quot;file(&quot; atom &quot;)&quot;
   | &quot;file(&quot; atom &quot;,&quot; atom &quot;)&quot;
   | &quot;lines(&quot; integer &quot;,&quot; integer &quot;)&quot;
   | &quot;directive(&quot; integer &quot;,&quot; integer &quot;)&quot;
   | &quot;events&quot;
   | &quot;source_data&quot;
   | &quot;public(&quot; entity_resources_list &quot;)&quot;
   | &quot;protected(&quot; entity_resources_list &quot;)&quot;
   | &quot;private(&quot; entity_resources_list &quot;)&quot;
   | &quot;declares(&quot; predicate_indicator &quot;,&quot; predicate_declaration_property_list &quot;)&quot;
   | &quot;defines(&quot; predicate_indicator &quot;,&quot; predicate_definition_property_list &quot;)&quot;
   | &quot;includes(&quot; predicate_indicator &quot;,&quot; ( object_identifier | category_identifier ) &quot;,&quot; predicate_definition_property_list &quot;)&quot;
   | &quot;provides(&quot; predicate_indicator &quot;,&quot; ( object_identifier | category_identifier ) &quot;,&quot; predicate_definition_property_list &quot;)&quot;
   | &quot;alias(&quot; ( object_identifier | module_identifier ) &quot;,&quot; entity_alias_property_list &quot;)&quot;
   | &quot;alias(&quot; predicate_indicator &quot;,&quot; predicate_alias_property_list &quot;)&quot;
   | &quot;calls(&quot; predicate &quot;,&quot; predicate_call_update_property_list &quot;)&quot;
   | &quot;updates(&quot; predicate &quot;,&quot; predicate_call_update_property_list &quot;)&quot;
   | &quot;number_of_clauses(&quot; integer &quot;)&quot;
   | &quot;number_of_rules(&quot; integer &quot;)&quot;
   | &quot;number_of_user_clauses(&quot; integer &quot;)&quot;
   | &quot;number_of_user_rules(&quot; integer &quot;)&quot;
   | &quot;debugging&quot;

object_property <span class="o">::=</span>
   &quot;static&quot;
   | &quot;dynamic&quot;
   | &quot;built_in&quot;
   | &quot;threaded&quot;
   | &quot;file(&quot; atom &quot;)&quot;
   | &quot;file(&quot; atom &quot;,&quot; atom &quot;)&quot;
   | &quot;lines(&quot; integer &quot;,&quot; integer &quot;)&quot;
   | &quot;directive(&quot; integer &quot;,&quot; integer &quot;)&quot;
   | &quot;context_switching_calls&quot;
   | &quot;dynamic_declarations&quot;
   | &quot;events&quot;
   | &quot;source_data&quot;
   | &quot;complements(&quot; ( &quot;allow&quot; | &quot;restrict&quot; ) &quot;)&quot;
   | &quot;complements&quot;
   | &quot;public(&quot; entity_resources_list &quot;)&quot;
   | &quot;protected(&quot; entity_resources_list &quot;)&quot;
   | &quot;private(&quot; entity_resources_list &quot;)&quot;
   | &quot;declares(&quot; predicate_indicator &quot;,&quot; predicate_declaration_property_list &quot;)&quot;
   | &quot;defines(&quot; predicate_indicator &quot;,&quot; predicate_definition_property_list &quot;)&quot;
   | &quot;includes(&quot; predicate_indicator &quot;,&quot; ( object_identifier | category_identifier ) &quot;,&quot; predicate_definition_property_list &quot;)&quot;
   | &quot;provides(&quot; predicate_indicator &quot;,&quot; ( object_identifier | category_identifier ) &quot;,&quot; predicate_definition_property_list &quot;)&quot;
   | &quot;alias(&quot; ( object_identifier | module_identifier ) &quot;,&quot; entity_alias_property_list &quot;)&quot;
   | &quot;alias(&quot; predicate_indicator &quot;,&quot; predicate_alias_property_list &quot;)&quot;
   | &quot;calls(&quot; predicate &quot;,&quot; predicate_call_update_property_list &quot;)&quot;
   | &quot;updates(&quot; predicate &quot;,&quot; predicate_call_update_property_list &quot;)&quot;
   | &quot;number_of_clauses(&quot; integer &quot;)&quot;
   | &quot;number_of_rules(&quot; integer &quot;)&quot;
   | &quot;number_of_user_clauses(&quot; integer &quot;)&quot;
   | &quot;number_of_user_rules(&quot; integer &quot;)&quot;
   | &quot;module&quot;
   | &quot;debugging&quot;

protocol_property <span class="o">::=</span>
   &quot;static&quot;
   | &quot;dynamic&quot;
   | &quot;built_in&quot;
   | &quot;source_data&quot;
   | &quot;file(&quot; atom &quot;)&quot;
   | &quot;file(&quot; atom &quot;,&quot; atom &quot;)&quot;
   | &quot;lines(&quot; integer &quot;,&quot; integer &quot;)&quot;
   | &quot;directive(&quot; integer &quot;,&quot; integer &quot;)&quot;
   | &quot;public(&quot; entity_resources_list &quot;)&quot;
   | &quot;protected(&quot; entity_resources_list &quot;)&quot;
   | &quot;private(&quot; entity_resources_list &quot;)&quot;
   | &quot;declares(&quot; predicate_indicator &quot;,&quot; predicate_declaration_property_list &quot;)&quot;
   | &quot;alias(&quot; predicate_indicator &quot;,&quot; predicate_alias_property_list &quot;)&quot;
   | &quot;debugging&quot;

predicate_declaration_property_list <span class="o">::=</span>
   &quot;[&quot; predicate_declaration_property_sequence &quot;]&quot;

predicate_declaration_property_sequence <span class="o">::=</span>
   predicate_declaration_property
   | predicate_declaration_property &quot;,&quot; predicate_declaration_property_sequence

predicate_declaration_property <span class="o">::=</span>
   &quot;static&quot;
   | &quot;dynamic&quot;
   | &quot;scope(&quot; scope &quot;)&quot;
   | &quot;private&quot;
   | &quot;protected&quot;
   | &quot;public&quot;
   | &quot;coinductive&quot;
   | &quot;multifile&quot;
   | &quot;synchronized&quot;
   | &quot;meta_predicate(&quot; meta_predicate_template &quot;)&quot;
   | &quot;coinductive(&quot; coinductive_predicate_template &quot;)&quot;
   | &quot;non_terminal(&quot; non_terminal_indicator &quot;)&quot;
   | &quot;include(&quot; atom &quot;)&quot;
   | &quot;lines(&quot; integer  &quot;,&quot; integer &quot;)&quot;
   | &quot;line_count(&quot; integer &quot;)&quot;
   | &quot;mode(&quot; ( predicate_mode_term | non_terminal_mode_term ) &quot;,&quot; number_of_proofs &quot;)&quot;
   | &quot;info(&quot; list &quot;)&quot;

predicate_definition_property_list <span class="o">::=</span>
   &quot;[&quot; predicate_definition_property_sequence &quot;]&quot;

predicate_definition_property_sequence <span class="o">::=</span>
   predicate_definition_property
   | predicate_definition_property &quot;,&quot; predicate_definition_property_sequence

predicate_definition_property <span class="o">::=</span>
   &quot;inline&quot;
   | &quot;auxiliary&quot;
   | &quot;non_terminal(&quot; non_terminal_indicator &quot;)&quot;
   | &quot;include(&quot; atom &quot;)&quot;
   | &quot;lines(&quot; integer  &quot;,&quot; integer &quot;)&quot;
   | &quot;line_count(&quot; integer &quot;)&quot;
   | &quot;number_of_clauses(&quot; integer &quot;)&quot;
   | &quot;number_of_rules(&quot; integer &quot;)&quot;

entity_alias_property_list <span class="o">::=</span>
   &quot;[&quot; entity_alias_property_sequence &quot;]&quot;

entity_alias_property_sequence <span class="o">::=</span>
   entity_alias_property
   | entity_alias_property &quot;,&quot; entity_alias_property_sequence

entity_alias_property <span class="o">::=</span>
   &quot;object&quot;
   | &quot;module&quot;
   | &quot;for(&quot; ( object_identifier | module_identifier ) &quot;)&quot;
   | &quot;include(&quot; atom &quot;)&quot;
   | &quot;lines(&quot; integer  &quot;,&quot; integer &quot;)&quot;
   | &quot;line_count(&quot; integer &quot;)&quot;

predicate_alias_property_list <span class="o">::=</span>
   &quot;[&quot; predicate_alias_property_sequence &quot;]&quot;

predicate_alias_property_sequence <span class="o">::=</span>
   predicate_alias_property
   | predicate_alias_property &quot;,&quot; predicate_alias_property_sequence

predicate_alias_property <span class="o">::=</span>
   &quot;predicate&quot;
   | &quot;for(&quot; predicate_indicator &quot;)&quot;
   | &quot;from(&quot; entity_identifier &quot;)&quot;
   | &quot;non_terminal(&quot; non_terminal_indicator &quot;)&quot;
   | &quot;include(&quot; atom &quot;)&quot;
   | &quot;lines(&quot; integer  &quot;,&quot; integer &quot;)&quot;
   | &quot;line_count(&quot; integer &quot;)&quot;

predicate <span class="o">::=</span>
   predicate_indicator
   | &quot;^^&quot; predicate_indicator
   | &quot;::&quot; predicate_indicator
   | ( variable | object_identifier ) &quot;::&quot; predicate_indicator
   | ( variable | module_identifier ) &quot;:&quot; predicate_indicator

predicate_call_update_property_list <span class="o">::=</span>
   &quot;[&quot; predicate_call_update_property_sequence &quot;]&quot;

predicate_call_update_property_sequence <span class="o">::=</span>
   predicate_call_update_property
   | predicate_call_update_property &quot;,&quot; predicate_call_update_property_sequence

predicate_call_update_property <span class="o">::=</span>
   &quot;caller(&quot; predicate_indicator &quot;)&quot;
   | &quot;include(&quot; atom &quot;)&quot;
   | &quot;lines(&quot; integer  &quot;,&quot; integer &quot;)&quot;
   | &quot;line_count(&quot; integer &quot;)&quot;
   | &quot;alias(&quot; predicate_indicator &quot;)&quot;
   | &quot;non_terminal(&quot; non_terminal_indicator &quot;)&quot;
</pre></div>
</div>
</section>
<section id="predicate-properties">
<span id="grammar-predicate-properties"></span><h2>Predicate properties<a class="headerlink" href="#predicate-properties" title="Link to this heading"></a></h2>
<div class="highlight-bnf notranslate"><div class="highlight"><pre><span></span>predicate_property <span class="o">::=</span>
   &quot;static&quot;
   | &quot;dynamic&quot;
   | &quot;scope(&quot; scope &quot;)&quot;
   | &quot;private&quot;
   | &quot;protected&quot;
   | &quot;public&quot;
   | &quot;logtalk&quot;
   | &quot;prolog&quot;
   | &quot;foreign&quot;
   | &quot;coinductive(&quot; coinductive_predicate_template &quot;)&quot;
   | &quot;multifile&quot;
   | &quot;synchronized&quot;
   | &quot;built_in&quot;
   | &quot;inline&quot;
   | &quot;recursive&quot;
   | &quot;declared_in(&quot; entity_identifier &quot;)&quot;
   | &quot;defined_in(&quot; ( object_identifier | category_identifier ) &quot;)&quot;
   | &quot;redefined_from(&quot; ( object_identifier | category_identifier ) &quot;)&quot;
   | &quot;meta_predicate(&quot; meta_predicate_template &quot;)&quot;
   | &quot;alias_of(&quot; callable &quot;)&quot;
   | &quot;alias_declared_in(&quot; entity_identifier &quot;)&quot;
   | &quot;non_terminal(&quot; non_terminal_indicator &quot;)&quot;
   | &quot;mode(&quot; ( predicate_mode_term | non_terminal_mode_term ) &quot;,&quot; number_of_proofs &quot;)&quot;
   | &quot;info(&quot; list &quot;)&quot;
   | &quot;number_of_clauses(&quot; integer &quot;)&quot;
   | &quot;number_of_rules(&quot; integer &quot;)&quot;
   | &quot;declared_in(&quot; entity_identifier &quot;,&quot; line_count &quot;)&quot;
   | &quot;defined_in(&quot; ( object_identifier | category_identifier ) &quot;,&quot; line_count &quot;)&quot;
   | &quot;redefined_from(&quot; ( object_identifier | category_identifier ) &quot;,&quot; line_count &quot;)&quot;
   | &quot;alias_declared_in(&quot; entity_identifier &quot;,&quot; line_count &quot;)&quot;

line_count <span class="o">::=</span>
   integer
</pre></div>
</div>
</section>
<section id="compiler-flags">
<span id="grammar-compiler-flags"></span><h2>Compiler flags<a class="headerlink" href="#compiler-flags" title="Link to this heading"></a></h2>
<div class="highlight-bnf notranslate"><div class="highlight"><pre><span></span>compiler_flag <span class="o">::=</span>
   flag &quot;(&quot; flag_value &quot;)&quot;
</pre></div>
</div>
</section>
</section>


           </div>
          </div>
          <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
        <a href="index.html" class="btn btn-neutral float-left" title="Reference Manual" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
        <a href="control/index.html" class="btn btn-neutral float-right" title="Control constructs" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 1998-2025, Paulo Moura.</p>
  </div>

  Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
    <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
    provided by <a href="https://readthedocs.org">Read the Docs</a>.
   

</footer>
        </div>
      </div>
    </section>
  </div>
  <script>
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script> 

</body>
</html>